package com.ourchem.bus.enums;

public enum PublicCountryEnums {
    COUNTRY_ONE("中国","中国"),
    COUNTRY_TWO("美国","美国"),
    COUNTRY_THREE("英国","英国"),
    COUNTRY_FOUR("德国","德国"),
    COUNTRY_FIVE("日本","日本"),
    COUNTRY_SIX("中国台湾","中国港澳台"),
    COUNTRY_SEVEN("中国香港","中国港澳台"),
    COUNTRY_EIGHT("中国澳门","中国港澳台"),

    EN_COUNTRY_ONE("CN","中国"),
    EN_COUNTRY_TWO("US","美国"),
    EN_COUNTRY_THREE("GB","英国"),
    EN_COUNTRY_FOUR("DE","德国"),
    EN_COUNTRY_FIVE("JP","日本"),
    EN_COUNTRY_SIX("TW","中国港澳台"),
    EN_COUNTRY_SEVEN("HK","中国港澳台"),
    EN_COUNTRY_EIGHT("MO","中国港澳台"),

    OTHER_COUNTRY("其他地区","其他地区");

    private final String filed;
    private final String value;

    private PublicCountryEnums(String filed,String value) {
        this.value = value;
        this.filed = filed;
    }

    public String getValue() {
        return value;
    }

    public String getFiled() {
        return filed;
    }

    public static PublicCountryEnums countryOf(String filed) {
        for (PublicCountryEnums value : values()) {
            if (filed.equals(value.filed))
                return value;
        }

        return OTHER_COUNTRY;
    }
}
